<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDealersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('dealers', function (Blueprint $table) {
            $table->id();
            $table->string('code', 10)->unique()->comment('经销商惠享账号');
            $table->string('name')->comment('经销商名');
            $table->string('area_code',10)->comment('行政区号');
            $table->string('address')->comment('具体地址');
            $table->string('lat',30)->comment('精度');
            $table->string('lng',30)->comment('维度');
            $table->integer('level')->index()->comment('级别');
            $table->string('service_phone',20)->nullable()->comment('服务电话');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('dealers');
    }
}
